package com.kyub.test.model;

import java.util.List;
import java.util.ArrayList;

/**
 * Created by IntelliJ IDEA.
 * User: sreghenzi
 * Date: 7-gen-2009
 * Time: 16.02.16
 * To change this template use File | Settings | File Templates.
 */
public class Person {
    private Long id;

    private String name;

    private String picureUrl;

    private List<Pet> pets = new ArrayList<Pet>();

    public Person() {
    }


    public String getPicureUrl() {
        return picureUrl;
    }

    public void setPicureUrl(String picureUrl) {
        this.picureUrl = picureUrl;
    }

    public Person(Long id, String name) {
        this.id = id;
        this.name = name;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String toString() {
        return this.name;
    }

    public List<Pet> getPets() {
        return pets;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Person)) return false;

        Person person = (Person) o;

        if (id != null ? !id.equals(person.id) : person.id != null) return false;
        if (name != null ? !name.equals(person.name) : person.name != null) return false;

        return true;
    }

    public int hashCode() {
        int result;
        result = (id != null ? id.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        return result;
    }
}
